//package com.plian.system.enumeratea;
//
//import com.plian.spring.SpringUtil;
//import com.plian.system.dto.zzd.ZZDIndicatorsQuery;
//import com.plian.system.service.zzd.IZZDFinanceService;
//import com.plian.system.service.zzd.IZZDInvestmentAnnualService;
//import com.plian.system.service.zzd.IZZDPropertyService;
//import com.plian.system.vo.zzd.sys.IndicatorsInfoVO;
//import com.plian.system.vo.zzd.sys.OverviewIndicatorsValueVO;
//import lombok.Getter;
//
//import java.util.Arrays;
//import java.util.List;
//import java.util.function.Function;
//import java.util.stream.Collectors;
//
//@Getter
//public enum ZZDIndicatorsEnum {
//
//    TOTAL_ASSETS("totalAssets", "K22", "资产总额", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    TOTAL_NET_ASSETS("totalNetAssets", "K36", "净资产总额", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    BUSINESS_INCOME("businessIncome", "KLJ1", "营业收入", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    TOTAL_PROFIT("totalProfit", "KLJ19", "利润总额", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    TOTAL_LIABILITIES("totalLiabilities", "K30", "负债总额", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    TOTAL_LIABILITIES_RATIO("totalLiabilitiesRatio", "totalLiabilitiesRatio", "资产负债率", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    NET_ASSETS_ROE("netAssetsRoe", "JZCSYL", "净资产收益率", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    RD_INVESTMENT_INTENSITY("rdInvestmentIntensity", "rdInvestmentIntensity", "研发经费投入强度", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    LABOR_GENERATION_RATE("laborGenerationRate", "laborGenerationRate", "全员劳动生产率", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//    OPERATING_CASH_RATION("operatingCashRatio", "operatingCashRatio", "营业现金比率", SpringUtil.getBean(IZZDFinanceService.class)::getOverviewIndicatorsInfo),
//
//    YEAR_PLAN_INVESTMENT("yearPlanInvestment", "yearPlanInvestment", "本年计划投资", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//    YEAR_COMPLETE_INVESTMENT("yearCompleteInvestment", "yearCompleteInvestment", "已完成投资", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//    FIXED_ASSETS_INVESTMENT("fixedAssetsInvestment", "fixedAssetsInvestment", "固定资产投资", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//    EQUITY_INVESTMENT("equityInvestment", "equityInvestment", "股权投资", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//    EFFECTIVE_INVESTMENT("effectiveInvestmentCompletionRate", "effectiveInvestmentCompletionRate", "有效投资完成率", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//    KEY_PROJECT_INVESTMENT("keyProjectInvestmentCompletionRate", "keyProjectInvestmentCompletionRate", "重点项目投资完成率", SpringUtil.getBean(IZZDInvestmentAnnualService.class)::getOverviewInvestmentAnnual),
//
//    WHOLLY_OWNED("wholly", "045001", "全资", SpringUtil.getBean(IZZDPropertyService.class)::getOverviewPropertyType),
//    SHARE_OWNED("share", "045004", "参股", SpringUtil.getBean(IZZDPropertyService.class)::getOverviewPropertyType),
//    ABSOLUTE_OWNED("absolute", "045002", "绝对控股", SpringUtil.getBean(IZZDPropertyService.class)::getOverviewPropertyType),
//    ACTUAL_OWNED("actual", "045003", "实际控股", SpringUtil.getBean(IZZDPropertyService.class)::getOverviewPropertyType);
//
//    private String columnName;
//
//    private String columnCode;
//
//    private String indicatorsName;
//
//    private Function<ZZDIndicatorsQuery, OverviewIndicatorsValueVO> function;
//
//    ZZDIndicatorsEnum(String columnName, String columnCode, String indicatorsName, Function<ZZDIndicatorsQuery, OverviewIndicatorsValueVO> function){
//        this.columnName = columnName;
//        this.columnCode = columnCode;
//        this.indicatorsName = indicatorsName;
//        this.function = function;
//    }
//
//    public static ZZDIndicatorsEnum getByColumnName(String columnName){
//        for (ZZDIndicatorsEnum value : ZZDIndicatorsEnum.values()){
//            if (value.columnName.equals(columnName)){
//                return value;
//            }
//        }
//        return null;
//    }
//
//    public static Function<ZZDIndicatorsQuery, OverviewIndicatorsValueVO> getFunctionByColumnName(String columnName){
//        for (ZZDIndicatorsEnum value : ZZDIndicatorsEnum.values()){
//            if (value.columnName.equals(columnName)){
//                return value.function;
//            }
//        }
//        return null;
//    }
//
//    public static List<IndicatorsInfoVO> getAllIndicatorsInfo(){
//        return Arrays.stream(ZZDIndicatorsEnum.values()).map(zzdIndicatorsEnum ->IndicatorsInfoVO.builder()
//                .indicatorsName(zzdIndicatorsEnum.indicatorsName)
//                .columnName(zzdIndicatorsEnum.columnName)
//                .columnCode(zzdIndicatorsEnum.columnCode)
//                .build()).collect(Collectors.toList());
//    }
//}
